package net.slenderloris.touchclient;

import java.util.LinkedList;

import android.view.MotionEvent;
import android.view.View;

public class TouchStates {

	private static final byte ACTION_UP = 0x1;
	private static final byte ACTION_DOWN = 0x2;
	private static final byte ACTION_MOVE = 0x3;
	
	private static final int MAX_TOUCHES = 16;
	
	private static class TouchState {
		int id;
		int x;
		int y;
		boolean down = false;
	}

	private TouchState[] mTouchStates = new TouchState[MAX_TOUCHES];
	
	public TouchStates() {
		for(int i=0; i<MAX_TOUCHES; i++) {
			mTouchStates[i] = new TouchState();
		}
	}

	public boolean onTouch(MotionEvent event) {
		switch(event.getActionMasked()) {
		case MotionEvent.ACTION_POINTER_DOWN:
			onPointerDown(event);
			break;
		case MotionEvent.ACTION_POINTER_UP:
			onPointerUp(event);
			break;
		case MotionEvent.ACTION_MOVE:
			onMoved(event);
			break;
		}
		return true;
	}

	private void onPointerDown(MotionEvent event) {
		int index = event.getActionIndex();
		int id = event.getPointerId(index);
		if(id<MAX_TOUCHES) {
			//TouchStates
		}
	}

	
	private void onMoved(MotionEvent event) {
		// TODO Auto-generated method stub
		
	}

	private void onPointerUp(MotionEvent event) {
		// TODO Auto-generated method stub
		
	}

		
	
	
	
	
	
	
	
	
	
	
}
